import {request} from "../request.ts";

/**
 * 分页参数
 */
export type page = {
    pageNum: number;
    pageSize: number;
}

/**
 * 获取视频分页数据
 * @param page
 */
export const listVideo = (page: page): Promise<any> => (request.get(`/video/video/list?pageNum=${page.pageNum}&pageSize=${page.pageSize}`))

/**
 * 获取所有视频分类
 */
export const videoClass = (): Promise<any> => (request.get('/video/video/class'))

/**
 * 搜索资源列表
 * @param page 分页
 * @param query 查询资源名称
 */
export const queryVideo = (page: page, query: string): Promise<any> => (request.get(`/video/video/list?pageNum=${page.pageNum}&pageSize=${page.pageSize}&vodName=${query}`))
